#include "compare.h"
#include <iostream>

outcome compare(p_r_s player, p_r_s machine) {
    outcome result;

    if (player == machine) {
        return tie;
    }

    if (player == rock) {
        if (machine == scissor || machine == water) result = win;
        else result = lose;
    }

    if (player == scissor) {
        if (machine == fire || machine == water) result = win;
        else result = lose;
    }

    if (player == water) {
        if (machine == fire || machine == paper) result = win;
        else result = lose;
    }

    if (player == fire) {
        if (machine == paper || machine == rock) result = win;
        else result = lose;
    }

    if (player == paper) {
        if (machine == rock || machine == scissor) result = win;
        else result = lose;
    }

    return result;
}